<template>
	<view class="m_css">
		<view class="text_css">
			请输入卷码信息
		</view>
		<view class="inp_css">
			<input type="text" v-model="form.code" placeholder="请输入......" clearable />
		</view>
		<view class="btn_css" @click="handleUse">
			核 &nbsp;&nbsp;&nbsp;&nbsp; 验
		</view>
	</view>
</template>

<script>
	import {
		disInfo
	} from "@/api/app/index.js"
	export default {
		data() {
			return {
				form: {
					code: ''
				}
			}
		},

		methods: {
			handleUse() {
				if (!this.form.code) {
					uni.showToast({
						title: '请输入卷码信息',
						icon: 'none'
					})
					return
				}

				disInfo(this.form).then(res => {
					if (res.code === 500) {
						this.$emit('openFail')
					} else {
						this.$emit('openPass', res.data)
					}
				})

			},
		}
	}
</script>

<style scoped>
	.m_css {
		width: 100%;
		padding: 20rpx 32rpx;
		box-sizing: border-box;
	}

	.text_css {
		width: 100%;
		height: auto;
		font-family: Source Han Sans;
		font-size: 32rpx;
		font-weight: 350;
		color: rgba(0, 0, 0, 0.7);
		margin-bottom: 26rpx;
		padding: 16rpx;
	}

	.inp_css {
		width: 100%;
		height: 84rpx;
		position: relative;
		margin-bottom: 68rpx;
	}

	.inp_css input {
		width: 100%;
		height: 100%;
		margin: auto;
		border-radius: 26rpx;
		padding-left: 32rpx;
		padding-right: 32rpx;
		font-size: 32rpx;
		font-weight: 350;
		box-sizing: border-box;
		font-family: Source Han Sans;
		background: #FFFFFF;
		border: 1px solid rgba(0, 0, 0, 0.05);
	}

	.inp_css input::placeholder {
		color: rgba(0, 0, 0, 0.4);
	}

	.btn_css {
		width: 100%;
		height: 84rpx;
		border-radius: 8rpx;
		background: #438DFF;

		font-family: Source Han Sans;
		font-size: 28rpx;
		font-weight: 350;
		color: #FFFFFF;
		display: flex;
		align-items: center;
		justify-content: center;

	}
</style>